<template>
  <div>

    <el-table
      :data="member_Arr"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      :tree-props="{children: 'children'}"
    >
      <el-table-column prop="id" label="用户编号"></el-table-column>
      <el-table-column prop="nickname" label="昵称"></el-table-column>
      <el-table-column prop="phone" label="手机号"></el-table-column>
      
      <el-table-column prop="status" label="状态">
        <template slot-scope="scope">
          <el-button type="primary" v-if="scope.row.status===1">启用</el-button>
          <el-button type="info" v-else>禁用</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="address" label="操作">
        <template slot-scope="scope">
          <el-button type="primary" @click="edit(scope.row.uid)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
props: [],
computed: {
...mapGetters({
  member_Arr:'member/member_Arr'
})
},
activated() {
    this.set_memberArr();
  },
  methods: {
    ...mapActions({
        set_memberArr:"member/set_memberArr"
    }),
    // 2.7 点了编辑
    edit(id) {
      this.$router.push('/member/edit/'+id)
    },
  }
};
</script>

<style scoped lang="less">

</style>